<!--#include file="..\..\CheckSession.inc"-->
<!--#include file="..\..\RootContent.inc"-->
<!--#include file=..\..\getFormName.inc-->
<%	IDFlow=request("IDFlow")
	Nguoitao=request("Nguoitao")
	Filename=Request("Filename")
	UName=Request("Username")
	Hanxuly=Request("Hanxuly")
	MaCB=Request("MaCB")
	Tentep=Request("Tentep")
	Maflow=Request("Maflow")
	bMaRoot=Request("bMaRoot")
	Yeucau=Request("Yeucau")
	bDatao=Request("bDatao")

	Set ClsFun=server.CreateObject("Vinalines.ClsFunction")
	Backform=Request("Backform")+1
	set TextFile=server.CreateObject("Vinalines.ClsFile")
	bComm=Request("bComm")
	bMa=Request("bMa")
	bdaxuly=Request("bdaxuly")
	if bComm="ghi" then
		'Save TEXT		
		Path=RootContent & "\Data\xuly\TEXT"
		'Path=Path & "\" & bMa & ".VT"
		Path=Path & "\" & ClsFun.Giaima(Maflow) & ".VT"
		TextFile.SaveFile Request("Body"),Path
		bdaxuly="xulyok"
	end if	
%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft FrontPage 4.0">
<meta charset="UTF-8">
<TITLE></TITLE>
<script language=vbscript runat=server>
	Function ModiString(mess_s)
		message = Replace("" & mess_s,"'", "''")
		ModiString=message
	End function
</script>	
<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--

function CmdOK_onclick() {
	frmeditor.Body.value=document.all.dynamsg.html;
	frmeditor.action="frmedit.asp?Nguoitao="+"<%=Nguoitao%>"+"&bMaRoot="+"<%=bMaRoot%>"+"&bComm=ghi&Maflow="+"<%=Maflow%>"+"&IDFlow="+"<%=IDFlow%>"+"&Backform="+"<%=Backform%>"+"&bDatao="+"<%=bDatao%>"+"&Filename="+"<%=Filename%>"+"&UName="+"<%=UName%>"+"&Hanxuly="+"<%=Hanxuly%>"+"&MaCB="+"<%=MaCB%>"+"&Tentep="+"<%=Tentep%>"+"&Yeucau="+"<%=Yeucau%>";
	frmeditor.submit();
	
}
function CmdAttach_onclick() {
	frmeditor.Body.value=document.all.dynamsg.html;
	frmeditor.target="right";
	frmeditor.action="Attach.asp?Nguoitao="+"<%=Nguoitao%>"+"&bMaRoot="+"<%=bMaRoot%>"+"&bPost=ok&Maflow=<%=Maflow%>"+"&IDFlow="+"<%=IDFlow%>"+"&bdaxuly="+"<%=bdaxuly%>"+"&Yeucau="+"<%=Yeucau%>"+"&Backform="+"<%=Backform%>"+"&bDatao="+"<%=bDatao%>"+"&Filename="+"<%=Filename%>"+"&UName="+"<%=UName%>"+"&Hanxuly="+"<%=Hanxuly%>"+"&MaCB="+"<%=MaCB%>"+"&Tentep="+"<%=Tentep%>";
	frmeditor.submit();
}
function CmdExit_onclick() {
	<%if bdaxuly="xulyok" then %>
		frmeditor.target="right";
		frmeditor.action="../xuly.asp?bComm=xulyok&Status=2&bDatao="+"<%=bDatao%>"+"&IDFlow="+"<%=IDFlow%>"+"&Nguoitao="+"<%=Nguoitao%>"+"&Filename="+"<%=Filename%>"+"&UName="+"<%=UName%>"+"&Hanxuly="+"<%=Hanxuly%>"+"&MaCB="+"<%=MaCB%>"+"&Tentep="+"<%=Tentep%>"+"&Maflow="+"<%=Maflow%>"+"&bMaRoot="+"<%=bMaRoot%>"+"&Yeucau="+"<%=Yeucau%>";
		frmeditor.submit();
	<%else%>
		/*frmeditor.target="right";
		frmeditor.action="../xuly.asp?bComm=xulyok&Status=1&bDatao="+"<%=bDatao%>";
		frmeditor.submit();*/
		window.history.go(-<%=Backform%>);
	<%end if%>
}
function CmdXem_onclick() {
	frmeditor.target="_blank";
	frmeditor.action="../Xemnoidung.asp?Maflow=<%=Maflow%>&bMa=<%=IDFlow%>";
	frmeditor.submit();
	frmeditor.target="right";
}
//-->
</SCRIPT>
</HEAD>
<BODY bgcolor="#F8F9D9" style="font-family:Arial" leftmargin=0 topmargin=0 LANGUAGE=javascript onload="return window_onload()">
<form name=frmeditor method=post>	
	<input type=hidden name=IDFlow value='<%=IDFlow%>'>
	<input type=hidden name=Nguoitao value='<%=Nguoitao%>'>
	<input type=hidden name=UserName value='<%=UName%>'>
	<input type=hidden name=Hanxuly value='<%=Hanxuly%>'>
	<input type=hidden name=MaCB value='<%=MaCB%>'>
	<input type=hidden name=Tentep value='<%=Tentep%>'>
	<input type=hidden name=Maflow value='<%=Maflow%>'>
	<input type=hidden name=bMaRoot value='<%=bMaRoot%>'>
	<input type=hidden name=Yeucau value='<%=Yeucau%>'>
	<input type=hidden name=bDatao value='<%=bDatao%>'>	
	<input type=hidden name=Filename value='<%=Filename%>'>	
	<div style='position:relative;top=0px;left=0px;height:250' width=100%>
		<%if bComm="" then%>
			<%	
				path=RootContent & "\Data\xuly\Text\"
				Path=Path & "\" & ClsFun.Giaima(Maflow) & ".VT"
			%>
			<textarea name="Body" style='visibility:hidden;position:absolute;top:0px;left:0px' rows="5" cols="20%"><%=TextFile.ReadTextFile(path)%></textarea>			
		<%else%>		
			<textarea name="Body" style='visibility:hidden;position:absolute;top:0px;left:0px' rows="5" cols="20%"><%=Request("Body")%></textarea>
		<%end if%>
		<div id="plainmsg" style='visibility:hidden;position:absolute;top:0px;left:0px'></div>
		<object id="dynamsg" width="100%" style="position:absolute;top:0px;left:0px" height="330" data="deditor.html" viewastext type="text/x-scriptlet"></object>
	</div>				
	<Table border=0 width=100% style='position:absolute;top:335px;left:0px'>
		<TR>
			<TD width=50%>
				<input type=button name=CmdAttach value="G&#7855;n k&#232;m t&#7879;p tin" style='font-family:Arial;width:120' LANGUAGE=javascript onclick="return CmdAttach_onclick()">
				<input type=button name=CmdXem value="Xem văn bản gốc" style='font-family:Arial;width:120' LANGUAGE=javascript onclick="return CmdXem_onclick()">
			</TD>
			<TD width=50% align=right>												
			<input type=Button value="Ghi nh&#7853;n" name=CmdOK  style='font-family:Arial;width:100' LANGUAGE=javascript onclick="return CmdOK_onclick()">				
			<input type=Button value="Tho&#225;t" name=CmdExit style='font-family:Arial;width:100'  LANGUAGE=javascript onclick="return CmdExit_onclick()">
			</TD>
		<TR>
	</Table>	
</form>
</BODY>
</HTML>
<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
	function window_onload() {
		document.all.dynamsg.html=frmeditor.Body.value;
	}
</Script>
<%
set TextFile=nothing
set ClsFun=nothing
%>